/**
 * Created by zsk on 16-3-22.
 */
var checkLogin = function(req,res,next) {
    console.log(req.session.user);
    if (!req.session.user) {
        req.flash('error','未登录');
        res.redirect('admin');
    }
    next();
};
var checkNotLogin = function(req, res, next) {
    console.log(req.session.user);
    if (req.session.user) {
        req.flash('error', '已登录!');
        res.redirect('back');
    }
    next();
};

exports.checkLogin = checkLogin;
exports.checkNotLogin = checkNotLogin;

